<html>
<title>vue-resource</title>

<head>
    <script src="./js/vue.js"></script>
    <script src="./js/vue-resource.js"></script>
    <script>
        window.onload = function () {
            let app = new Vue({
                el: '.container',
                data: {

                },
                methods: {
                        //https://sug.so.360.cn/suggest?
                        //callback=suggest_so&
                        //encodein=utf-8&
                        //encodeout=utf-8&
                        //format=json&
                        //src=so_home&
                        //fields=word&
                        //word=a&
                        //huid=11VUyGywOfrROehVvEEzwJLuEllYbsId57PaN%2BTjWdhUQ%3D&llbq=A5%2CB5%2CC5%2CD5&cache=&
                        //id=
                    send() {
                        this.$http.jsonp("https://sug.so.360.cn/suggest",{
                            params:{
                                callback:"suggest_so",
                                encodein:"utf-8",
                                encodeout:"utf-8",
                                format:"json",
                                src:"so_home",
                                fields:"word",
                                word:"a",
                                huid:"11VUyGywOfrROehVvEEzwJLuEllYbsId57PaN%2BTjWdhUQ%3D&llbq=A5%2CB5%2CC5%2CD5F"
                            }
                        }).then(resp => {
                                console.log(resp.data);
                            }).catch(//请求失败
                                resp => {
                                    console.log("请求失败：" + resp.status + ',' + resp.statusText);
                                }
                            );
                    }
                }
            })
        }
    </script>
</head>

<body>
    <div class="container">
        <button @click="send">点击一下</button>
    </div>
</body>

</html>